Gentoo compatible stuff has to be done *before* the set -e. You could also do
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 5 Oct 2005 18:15:56 +0000 (19:15 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 5 Oct 2005 18:15:56 +0000 (19:15 +0100)
the which in the if with a combination of ! and || after the set -e but I think
it's cleaner to just do it before the set -e.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
tools/examples/network-bridge

index f862db0c3f61a49264e8cc21f6e4b64dd407107d..f0e1e1648d9e8d737d52871671d96f97529977c0 100755 (executable)
 #
 #============================================================================
 
+# Gentoo doesn't have ifup/ifdown: define appropriate alternatives
+which ifup >& /dev/null
+if [ "$?" != 0 -a -e /etc/conf.d/net ]; then
+    ifup() {
+        /etc/init.d/net.$1 start
+    }
+    ifdown() {
+        /etc/init.d/net.$1 stop
+    }
+fi
+
 # Exit if anything goes wrong.
 set -e 
 
@@ -55,17 +66,6 @@ antispoof=${antispoof:-no}
 
 echo "*network $OP bridge=$bridge netdev=$netdev antispoof=$antispoof" >&2
 
-# Gentoo doesn't have ifup/ifdown: define appropriate alternatives
-which ifup >& /dev/null
-if [ "$?" != 0 -a -e /etc/conf.d/net ]; then
-    ifup() {
-        /etc/init.d/net.$1 start
-    }
-    ifdown() {
-        /etc/init.d/net.$1 stop
-    }
-fi
-
 # Usage: transfer_addrs src dst
 # Copy all IP addresses (including aliases) from device $src to device $dst.
 transfer_addrs () {